<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>运算符</title>
</head>
<body>
<!--
    三元运算：表达式？正确结果：错误结果
    算术运算：+，-，*，/，%
    关系比较：> , < , >= , <=()
    相等判断：==，！=（eq，ne）
-->
<h1>三元运算符 表达式？正确：错误</h1>
<div th:text="${sex eq 1 ? '男':'女'}"></div>
<div th:text="${sex == 1 ? '男':'女'}"></div>
<h1>算术运算</h1>
20+5=<span th:text="20+5"></span><br/>
20-5=<span th:text="20-5"></span><br/>
20*5=<span th:text="20*5"></span><br/>
20/5=<span th:text="20/5"></span><br/>
20%3=<span th:text="20%5"></span><br/>
<h1>关系比较</h1>
5>2为<span th:if="5 gt 2">true</span><br/>
5<2为<span th:unless="5 lt 2">true</span><br/>
1>=1为<span th:if="1 ge 1">true</span><br/>
1<=1为<span th:if="1 le 1">true</span><br/>
<h1>相等判断</h1>
<span th:if="${sex == 1}">男</span><br/>
<span th:if="${sex eq 1}">男</span><br/>
<span th:unless="${sex ne 1}">女</span><br/>
</body>
</html>